From: Eli Zaretskii Date: Tue, 25 Mar 2025 12:37:17 +0000 (+0200) Subject: ; Improve documentation of "function types" X-Git-Tag: archive/raspbian/1%30.2+1-2+rpi1^2~2^2~24^2~180 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=6a3e2b88d26db4f703c566cf9b508f8c83ea8850;p=emacs.git ; Improve documentation of "function types" * doc/lispref/functions.texi (Declare Form): * doc/lispref/objects.texi (Type Specifiers): Improve wording and indexing. --- diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 1da5208065e..824db5a0ec8 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -2727,12 +2727,15 @@ for the code emitted for the function (@pxref{Native-Compilation Variables}). @cindex function type declaration +@cindex inferred type of function @item (ftype @var{type} &optional @var{function}) Declare @var{type} to be the type of this function. This is used for documentation by @code{describe-function}. Also it can be used by the native compiler (@pxref{Native Compilation}) for improving code generation and for deriving more precisely the type of other functions -without type declaration. +without type declaration. Functions that have such type declarations +will be shown by @kbd{C-h C-f} as having a @dfn{declared type} (as +opposed to @dfn{inferred type} of functions without declaration). @var{type} is a @dfn{type specifier} (@pxref{Type Specifiers}) in the form @w{@code{(function (@var{arg-1-type} @dots{} @var{arg-n-type}) diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi index 630765213a2..264a780f93d 100644 --- a/doc/lispref/objects.texi +++ b/doc/lispref/objects.texi @@ -1552,9 +1552,9 @@ types and the return type of a function. Argument types can be interleaved with symbols @code{&optional} and @code{&rest} to match the function's arguments (@pxref{Argument List}). -The type specifier represent a function whose first parameter is of type -@code{symbol}, the second optional parameter is of type @code{float}, -and which returns an @code{integer}: +The following type specifier represents a function whose first parameter +is of type @code{symbol}, the second optional parameter is of type +@code{float}, and which returns an @code{integer}: @example (function (symbol &optional float) integer)